{% extends 'base.html' %}

{% block title %}
  {{ news_item.title }} :: {{ block.super }}
{% endblock %}

{% block sidebar %}
  {% include 'inc/_sidebar.html' %}
{% endblock %}

{% block content %}
  <div class="card mb-3">
    <div class="card-header">
      Категория: <a href="{{ news_item.category.get_absolute_url }}">{{ news_item.category.title }}</a>
    </div>
    <div class="card-body">
      {% if news_item.photo %}
        <img src="{{ news_item.photo.url }}" alt="" width="350" class="float-left mr-3">
      {% else %}
        <img src="https://picsum.photos/id/1060/350/235/?blur=2" alt="" class="float-left mr-3">
      {% endif %}
      <h5 class="card-title {% cycle 'text-danger' ' text-success' %}">{{ news_item.title }}</h5>
      <p class="card-text">{{ news_item.content|linebreaks }}</p>
    </div>
    <div class="card-footer text-muted">
      {{ news_item.created_at|date:"Y-m-d H:i:s" }}
    </div>
  </div>
{% endblock %}



